<?php
/**
 * Radcodes - SocialEngine Module
 *
 * @category   Application_Extensions
 * @package    Game
 * @copyright  Copyright (c) 2009-2010 Radcodes LLC (http://www.radcodes.com)
 * @license    http://www.radcodes.com/license/
 * @version    $Id$
 * @author     Vincent Van <vincent@radcodes.com>
 */
?>
<?php 
$game = $this->game;
?>

<div class='game_profile_info'>

  <div class="game_profile_info_photo">
    <?php echo $this->itemPhoto($game, 'thumb.normal');?>
  </div>

  <div class="game_profile_info_description">
    <div class="game_profile_info_title"><?php echo $this->translate('Description:')?></div>
    <div class="game_profile_info_body"><?php echo nl2br($this->game->getDescription()) ?></div>
  </div>
  <?php if ($this->game->instructions): ?>
    <div class="game_profile_info_instructions">
      <div class="game_profile_info_title"><?php echo $this->translate('Instructions:')?></div>
      <div class="game_profile_info_body"><?php echo nl2br($this->game->instructions); ?></div>
    </div>
  <?php endif;?>
  <?php if ($this->game->controls): ?>
    <div class="game_profile_info_controls">
      <div class="game_profile_info_title"><?php echo $this->translate('Controls:')?></div>
      <div class="game_profile_info_body"><?php echo nl2br($this->game->controls); ?></div>
    </div>
  <?php endif;?>
  <?php if (count($tagMaps = $game->tags()->getTagMaps()) > 0): ?>
    <?php $tagGames = array(); ?>
    <?php foreach ($tagMaps as $tagMap): $tag = $tagMap->getTag()?>
      <?php if (!empty($tag->text)):?>
        <?php $tagGames[] = '#'.$this->htmlLink(array('route'=>'game_general', 'action'=>'browse', 'tag'=>$tag->tag_id), $tag->text); ?>
      <?php endif; ?>
    <?php endforeach; ?>
    <div class="game_profile_info_tags">
      <div class="game_profile_info_title"><?php echo $this->translate('Tags:')?></div>
      <div class="game_profile_info_body"><?php echo join(" ", $tagGames); ?></div>
    </div>
  <?php endif; ?>
  <?php if ($this->fieldValues): ?>
    <div class="game_profile_info_details profile_fields">
      <div class="game_profile_info_title"><?php echo $this->translate('Other Details:')?></div>
      <?php echo $this->fieldValues; ?>
    </div> 
  <?php endif; ?>
</div>
